(PlayerMethods): Taxi Node Improvements#357
Merged
iThorgrim merged 3 commits intoazerothcore:masterfrom Feb 13, 2026
Merged
Conversation
…tead of lua_rawlen Using an index counter is more performant than using lua_rawlen every time since lua_rawlen can become expensive if the nodes list is very large.
Add HasKnownTaxiNode to PlayerMethods. This method will return `true` if the Player knows the given nodeId, `false` otherwise. This method is used in my Accountwide Taxi Paths script on my Github.
Aldori15
added a commit
to Aldori15/azerothcore-eluna-accountwide
that referenced
this pull request
Feb 9, 2026
This is a major overhaul of the entire accountwide system that I have been working on for the last week. It fixes a couple of bugs, but mostly caching optimizations for reduced DB read/writes with less lookups and just performance overall. Couple of notes: - As always, if you are doing a fresh install - just copy over the scripts and run the SQL file. If you are updating over an existing installation, copy & replace the old Lua files and also run the SQL file again. There was a new DB table added for the Reputation script, so you will need to run the SQL file. - If you use the AccountTaxiPaths script, you will need to update to my latest mod-ale fork as it contains an implementation for HasKnownTaxiNode: Aldori15/mod-ale@2fdd482. This method currently does NOT exist in Azerothcore's mod-ale repo. I submitted a Pull Request to the Azerothcore repo, so until that is approved/merged, you will need to use my fork or cherry pick the commit referenced above. azerothcore/mod-ale#357 I did thorough testing of all scripts but I am just one person. So if you encounter any issues, please open up a Bug/Issue or message me on discord @aldori
There was a problem hiding this comment.
Pull request overview
This PR optimizes the Lua Player:GetKnownTaxiNodes() implementation and adds a new Lua API Player:HasKnownTaxiNode(nodeId) to check whether a specific taxi node is known, supporting scripts that need fast per-node lookups.
Changes:
- Updated
GetKnownTaxiNodes()to use an incrementing index instead of repeatedly callinglua_rawlen. - Added
Player:HasKnownTaxiNode(nodeId)and registered it in the Lua Player method table.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
src/LuaEngine/methods/PlayerMethods.h |
Optimizes taxi node list construction and introduces HasKnownTaxiNode() implementation. |
src/LuaEngine/LuaFunctions.cpp |
Registers the new HasKnownTaxiNode Player method for Lua exposure. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
After Copilot review: - Use an unsigned cast for the shift instead of a signed int. - Make the early return !player case properly return a boolean value.
Author
|
Copilot review complete and resolved. |
iThorgrim
approved these changes
Feb 13, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GetKnownTaxiNodes() method should use an index counter instead of lua_rawlen. This is better than using lua_rawlen every time since it can become expensive if the nodes list is very large. This method was originally added by me in commit bcfe631
Add a new method called HasKnownTaxiNode() to PlayerMethods. This method simply returns true if the Player knows the nodeId or returns false otherwise.
GetKnownTaxiNodes() is used to return a table/list of all known taxi nodes by the Player. HasKnownTaxiNode() is used to simply check if a certain nodeId is known by the player, similarly to checks like HasSpell(), HasSkill(), etc. Both of these methods are actively used by the Accountwide Taxi Paths script on my Github repo.